package com.quan.bweb.controller;

import com.quan.bweb.entity.User;
import com.quan.bweb.interfaces.userInterface;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping(value = "/user")
public class userController {

    @Autowired
    userInterface userInterface;

    /**
     * http://localhost:8081/bweb/user/getUser?id=1
     * @param id
     * @return
     */
    @RequestMapping(value = "/getUser")
    @ResponseBody
    User getUser(@RequestParam("id") String id) {
        User user = new User();
        user.setName("luzequan");
        userInterface.getUser("1");
        return user;
    }

    @RequestMapping(value = "/test")
    @ResponseBody
    String test() {
        return "btest";
    }
}
